import request from '@/utils/request'
export default{
  //1.根据课程Id查询该课程下的所有章节
  getChapterAndVideoByCourseId(courseId){
    return request({
      url:'eduservice/chapter/getChapterAndVideoByCourseId/'+courseId,
      method:'get',
    })
  },
  //2.添加章节
  addChapter(chapter){
    return request({
      url:'eduservice/chapter/addChapter',
      method:'post',
      //将对象转换成json传输
      data:chapter
    })
  },
  //3.根据章节Id获取章节信息
  getChapterById(chapterId){
    return request({
      url:'eduservice/chapter/getChapterById/'+chapterId,
      method:'get'
    })
  },
  //4.修改章节
  updateChapter(chapter){
    return request({
      url:'eduservice/chapter/updateChapter',
      method:'put',
      data:chapter
    })
  },
  //5.删除章节
  deleteChapter(chapterId){
    return request({
      url:'eduservice/chapter/deleteChapter/'+chapterId,
      method:'delete',
    })
  }
}
